package com.qf.controller;

import com.qf.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    //从spring容器中获取User类型的对象,能获取的前提是容器中有
    @Autowired
    private User user;


    @GetMapping("/{uid}")
    public String getOne(@PathVariable("uid") Integer uid){
        System.out.println(user);
        return "success: " + uid;
    }
}
